/**
 * 
 */
package com.et114.modules.products.card.dao;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;
import com.et114.modules.products.card.vo.Card;
import com.et114.modules.products.search.SearchVo;

/*
 * @author guanhw
 */
public class CardDao extends SimpleTableDAOImpl {
	public DataList getCards( Card vo ) throws Exception {
		return queryListDataList ( vo , "getCards" ) ;
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< Card > getCardList( Card vo ) throws Exception {
		return queryList ( vo , "getCardsNPage" ) ;
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< Card  > getCardsHasOffTime( Card vo ) throws Exception {
		return queryList ( vo , "getCardsHasOffTime" ) ;
	}
	
	public Card getCardById( Long id ) throws Exception {
		return ( Card ) load( id , "getCardById" ) ;
	}
	
	public Long saveCard( Card vo ) throws Exception {
		return ( Long ) insert( vo , "insertCard" ) ; 
	}
	
	public void updateCard( Card vo ) throws Exception {
		update( vo , "updateCard" ) ; 
	}
	
	public void updateCardProOnOffStatus( Card vo ) throws Exception {
		update( vo , "updateCardProOnOffStatus" ) ; 
	}
	
	public void removeCard( Long proId ) throws Exception {
		delete( proId , "removeCard" ) ; 
	}
	
	// 4 q
	public DataList getCards4View( Card vo ) throws Exception {
		return queryListDataList ( vo , "getCards4View" ) ;
	}
	
	public Card getBaseCardById4View( Card vo ) throws Exception {
		return ( Card ) load( vo , "getBaseCardById4View" ) ;
	}	

	public SearchVo getCard4Compass( Long proId ) {
		return ( SearchVo )load(  new SearchVo( proId ) , "getCard4Compass" ) ;
	}	
}
